﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YJTTool.Configure.Model
{
    public class TimeTaskDto : INotifyPropertyChanged
    {
        private int id;
        private string timerName;
        private string hour;
        private string minute;
        private string second;
        private string days;
        private string repeat;
        private string interval;
        private string message;
        private string availability;

        public int Id
        {
            get => id;
            set
            {
                if (id != value)
                {
                    id = value;
                    OnPropertyChanged(nameof(Id));
                }
            }
        }

        public string TimerName
        {
            get => timerName;
            set
            {
                if (timerName != value)
                {
                    timerName = value;
                    OnPropertyChanged(nameof(TimerName));
                }
            }
        }

        public string Hour
        {
            get => hour;
            set
            {
                if (hour != value)
                {
                    hour = value;
                    OnPropertyChanged(nameof(Hour));
                }
            }
        }

        public string Minute
        {
            get => minute;
            set
            {
                if (minute != value)
                {
                    minute = value;
                    OnPropertyChanged(nameof(Minute));
                }
            }
        }

        public string Second
        {
            get => second;
            set
            {
                if (second != value)
                {
                    second = value;
                    OnPropertyChanged(nameof(Second));
                }
            }
        }

        public string Days
        {
            get => days;
            set
            {
                if (days != value)
                {
                    days = value;
                    OnPropertyChanged(nameof(Days));
                }
            }
        }

        public string Repeat
        {
            get => repeat;
            set
            {
                if (repeat != value)
                {
                    repeat = value;
                    OnPropertyChanged(nameof(Repeat));
                }
            }
        }

        public string Interval
        {
            get => interval;
            set
            {
                if (interval != value)
                {
                    interval = value;
                    OnPropertyChanged(nameof(Interval));
                }
            }
        }

        public string Message
        {
            get => message;
            set
            {
                if (message != value)
                {
                    message = value;
                    OnPropertyChanged(nameof(Message));
                }
            }
        }

        public string Availability
        {
            get => availability;
            set
            {
                if (availability != value)
                {
                    availability = value;
                    OnPropertyChanged(nameof(Availability));
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
